<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/inc/taglib.jsp"%>
<div class="pageHeader">
	<form id="pagerForm" onsubmit="return navTabSearch(this);" action="${pageContext.request.contextPath}/customer/shop/list" method="post"  enctype="multipart/form-data">
		<!-- 分页表单参数 -->
		<%@include file="/WEB-INF/page/inc/pageForm.jsp"%>
		
		<!-- 需要排序的字段 -->
		<input type="hidden" name="orderField" value="${requestScope.dwzPageBean.countResultMap.orderField}" />
		<!-- 正序倒序 -->
		<input type="hidden" name="orderDirection" value="${requestScope.dwzPageBean.countResultMap.orderDirection}" />
		
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>客户名称：<input type="text" name="shopName" value="${requestScope.dwzPageBean.countResultMap.shopName}" placeholder="输入客户名称" /></td>
					<td>所在区域：<input type="text" name="areaName" value="${requestScope.dwzPageBean.countResultMap.areaName}" placeholder="输入区域" /></td>
					<td>跟进时间：<input type="text" name="fwtm" class="date" value="<fmt:formatDate value="${requestScope.dwzPageBean.countResultMap.fwtm}" pattern="yyyy-MM-dd" />" placeholder="输入跟进时间" /></td>
				</tr>
				
			</table>
			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">查询</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<shiro:hasPermission name="/customer/shop/toInsert">
					<%-- <li><a class="add" href="${pageContext.request.contextPath}/customer/shop/toInsert" rel="insert" target="dialog" width="820" height="460" mask="true"><span>添加</span></a></li> --%>
			</shiro:hasPermission>
			<shiro:hasPermission name="/customer/shop/delete">
				<li><a class="delete" href="${pageContext.request.contextPath}/customer/shop/delete" rel="id" target="selectedTodo" title="确定要删除吗？" warn="请最小选择一条记录" mask="true"><span>批量删除</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="/customer/shop/excelExport">
			<li><a class="icon" href="${pageContext.request.contextPath}/customer/shop/excelExport" target="dwzExport" targettype="navTab" title="实要导出这些记录吗?"><span>导出EXCEL</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="/customer/shop/excelParser">
			<li><a class="icon" href="${pageContext.request.contextPath}/customer/shop/toUpload" rel="" target="dialog" width="820" height="460" mask="true"><span>导入EXCEL</span></a></li>
			</shiro:hasPermission>
		</ul>
	</div>
	<table class="table" targetType="navTab" asc="asc" desc="desc" width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="22"><input type="checkbox" group="shopId" class="checkboxCtrl"></th>
				<th orderField="shop_name" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'shop_name'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>客户名称</th>
				<th orderField="contacts" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'contacts'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>联系人</th>
				<th orderField="contact_number" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'contact_number'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>联系人号码</th>
				<th orderField="area_name" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'area_name'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>地区名称</th>
				<th orderField="shop_state" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'shop_state'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>店铺状态</th>
				<th orderField="sgtm" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'sgtm'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>签约时间</th>
				<th orderField="sfwtm" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'sfwtm'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>跟进时间</th>
				<th orderField="sodtm" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'sodtm'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>送货时间</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>

			<c:if test="${requestScope.dwzPageBean != null &&  requestScope.dwzPageBean.recordList != null }">
				<c:forEach var="record" items="${requestScope.dwzPageBean.recordList}" varStatus="status">
					<tr  ondblclick="openDetails(this)" target="dialog" href="${pageContext.request.contextPath}/customer/shop/toUpdate?id=${record.shopId}" title="编辑">
						<td><c:if test="${record.del!=3 }">
								<input name="id" value="${record.shopId}" type="checkbox">
							</c:if></td>
						<td>${record.shopName}</td>
						<td>${record.contacts}</td>
						<td>${record.contactNumber}</td>
						<td>${record.areaName}</td>
						<td>${record.shopState==0?'停用':'启用'}</td>
						<td><fmt:formatDate value="${record.sgtm}" pattern="yyyy-MM-dd" /></td>
						<td><fmt:formatDate value="${record.sfwtm}" pattern="yyyy-MM-dd " /></td>
						<td><fmt:formatDate value="${record.sodtm}" pattern="yyyy-MM-dd " /></td>
						<td>
							<%-- <a class="deleteBtn" title="授权角色" href="${pageContext.request.contextPath}/customer/shop/toUpdateRole?id=${record.shopId}" rel="update" target="dialog" width="820" height="460" mask="true"><span>授权角色</span></a> --%>
							<shiro:hasPermission name="/customer/shop/toUpdate">
							<a title="编辑" target="dialog" width="820" height="460" href="${pageContext.request.contextPath}/customer/shop/toUpdate?id=${record.shopId}" class="editBtn" mask="true"><span>编辑</span></a>
							</shiro:hasPermission>
							<c:if test="${record.del!=3}">
								<a title="确定要删除吗？" mask="true" target="ajaxTodo" href="${pageContext.request.contextPath}/customer/shop/delete?id=${record.shopId}" class="deleteBtn"><span>删除</span></a>
							</c:if>
							<shiro:hasPermission name="/customer/shopFollow/check">
							<a title="跟进" target="dialog" width="820" height="460" rel="genjin" href="${pageContext.request.contextPath}/customer/shopFollow/check?id=${record.shopId}" class="editBtn" mask="true"><span>跟进</span></a>
							</shiro:hasPermission>
							<shiro:hasPermission name="/customer/productInventory/listProduct">
							<a title="查看库存" target="dialog" width="820" height="460" rel="" href="${pageContext.request.contextPath}/customer/productInventory/listProduct?id=${record.shopId}" class="editBtn" mask="true"><span>查看库存</span></a>
							</shiro:hasPermission>
							</td>
					</tr>
				</c:forEach>
			</c:if>
		</tbody>
	</table>
	<!-- 分页条 -->
	<%@include file="/WEB-INF/page/inc/pageBar.jsp"%>
</div>